package com.egoo.ticket.server.utils.common;

import lombok.Data;

/**
 * @author：victor_tang
 * @Date:2019/9/20
 * @Description：数据响应类
 */
@Data
public class DbResponse {
	private int retCode;
	private String msg;
	private Object data;
	private Long count;
	private String url;

	public DbResponse() {
	}
	public DbResponse(int code, String msg) {
		this.retCode = code;
		this.msg = msg;
	}

	public DbResponse(int code, String msg, Object data) {
		this.retCode = code;
		this.msg = msg;
		this.data = data;
	}

	public DbResponse(int code, String msg, Object data, Long count) {
		this.retCode = code;
		this.msg = msg;
		this.data = data;
		this.count = count;
	}
	public static DbResponse getDbResponse(int code, String msg) {
		return new DbResponse(code, msg);
	}
	public static DbResponse getDbResponse(int code, String msg, Object data) {
		return new DbResponse(code, msg, data);
	}

	public static DbResponse getDbResponse(int code, String msg, Object data, Long count) {
		return new DbResponse(code, msg, data, count);
	}
	@Override
	public String toString() {
		return "DBResponse{" + "retCode=" + retCode + ", msg='" + msg + '\'' + ", data=" + data + ", count=" + count
				+ ", url='" + url + '\'' + '}';
	}
}
